package test;

public class Java02_Object_1 {
    public static void main(String[] args) {
        //TODO 面向对象
        Teacher t = new Teacher();
        t.name="王强";
        t.老师();

        Student s = new Student();
        s.name="小明";
        s.学生();

    }
}
class Teacher{
    String name;
    void 老师(){
        System.out.println(name+"老师在讲课。");
    }
}

class Student{
    String name;
    void 学生(){
        System.out.println("学生"+name+"在听课。");
    }
}



















